home *** CD-ROM | disk | FTP | other *** search
- Path: cs.ruu.nl!usenet
- From: wsldanke@cs.ruu.nl (Wessel Dankers)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: x ^= y ^= x ^= y;
- Date: 06 Mar 96 18:36:15 +0100
- Organization: Dept of Computer Science, Utrecht University, The Netherlands
- Message-ID: <1378.6639T1116T760@cs.ruu.nl>
- References: <1286.6624T1439T237@cs.ruu.nl> <3Du8y*20g@yaps.rhein.de>
- <3132C4BE.2D60@cs.ruu.nl> <4h3ivp$966@hasle.sn.no> <2099.6633T1231T2431@cs.ruu.nl> <4hie4f$978@wn1.sci.kun.nl>
- NNTP-Posting-Host: anx1p10.cc.ruu.nl
- X-Newsreader: THOR 2.22 (Amiga TCP/IP)
-
- Olaf Seibert <rhialto@mbfys.kun.nl> wrote:
- > In <2099.6633T1231T2431@cs.ruu.nl> wsldanke@cs.ruu.nl (Wessel Dankers)
- > writes:
- >>I.e. you can't assume anything about the order in which a statement is
- >>evaluated. So, if I write:
- >>printf("%d", time(NULL));
- >>my compiler could very well first print the time and then ask the system
- >>what time it is. Interesting thought. So, if I have the right compiler I can
-
- > Fortunately this is not true. The description of a function call says
- > that first the arguments are evaluated, then there is a sequence point,
- > then the funtion is called. I must admit that I would have to look up
- > what is said about the evaluation of the function to call (here it is
- > "printf" but it could have been something complicated like
- > "(mystruct.fpa[3 * i]->func)"): would that be before that sequence
- > point, after, or undefined.
-
- Hmmm. How about the C++ way,
- x.operator^=(y.operator^=(x.operator^=(y));
- That would introduce a sequence point, wouldn't it?
-
- --
- Wessel Dankers _\\|//_ <wsldanke@cs.ruu.nl>
- ///|\\\
- ----------------------------oOO--(_)---OOo----------------------------
- `Never imagine yourself not to be otherwise than what it might appear
- to others that what you were or might have been was not otherwise than
- what you had been would have appeared to them to be otherwise.'
-
-